.class public Lcom/esfile/screen/recorder/videos/edit/activities/caption/r;
.super Ljava/lang/Object;
.source "TextDecorationUtils.java"


# direct methods
.method public static a(Landroid/graphics/Paint;)F
    .locals 1

    if-nez p0, :cond_0

    const/4 p0, 0x0

    return p0

    .line 7
    :cond_0
    invoke-virtual {p0}, Landroid/graphics/Paint;->getFontMetrics()Landroid/graphics/Paint$FontMetrics;

    move-result-object p0

    .line 8
    iget v0, p0, Landroid/graphics/Paint$FontMetrics;->descent:F

    iget p0, p0, Landroid/graphics/Paint$FontMetrics;->ascent:F

    sub-float/2addr v0, p0

    return v0
.end method

.method public static a(Ljava/lang/String;F)F
    .locals 1

    .line 1
    invoke-static {p0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_0

    const/4 p0, 0x0

    return p0

    .line 2
    :cond_0
    new-instance v0, Landroid/graphics/Paint;

    invoke-direct {v0}, Landroid/graphics/Paint;-><init>()V

    .line 3
    invoke-virtual {v0, p1}, Landroid/graphics/Paint;->setTextSize(F)V

    const/4 p1, 0x1

    .line 4
    invoke-virtual {v0, p1}, Landroid/graphics/Paint;->setAntiAlias(Z)V

    const-string p1, "\n"

    .line 5
    invoke-virtual {p0, p1}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object p0

    .line 6
    invoke-static {v0}, Lcom/esfile/screen/recorder/videos/edit/activities/caption/r;->a(Landroid/graphics/Paint;)F

    move-result p1

    array-length p0, p0

    int-to-float p0, p0

    mul-float p1, p1, p0

    return p1
.end method

.method public static a(Landroid/content/Context;Ljava/util/List;II)V
    .locals 11
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Context;",
            "Ljava/util/List<",
            "Les/cd$r;",
            ">;II)V"
        }
    .end annotation

    if-eqz p1, :cond_1

    .line 9
    invoke-interface {p1}, Ljava/util/List;->isEmpty()Z

    move-result v0

    if-eqz v0, :cond_0

    goto :goto_1

    .line 10
    :cond_0
    new-instance v0, Landroid/graphics/Rect;

    const/4 v1, 0x0

    invoke-direct {v0, v1, v1, p2, p3}, Landroid/graphics/Rect;-><init>(IIII)V

    .line 11
    new-instance v1, Landroid/graphics/RectF;

    invoke-direct {v1}, Landroid/graphics/RectF;-><init>()V

    .line 12
    invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object p1

    :goto_0
    invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-eqz v2, :cond_1

    invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Les/cd$r;

    .line 13
    iget v3, v2, Les/cd$r;->b:F

    int-to-float v4, p2

    mul-float v3, v3, v4

    .line 14
    iget v5, v2, Les/cd$r;->c:F

    int-to-float v6, p3

    mul-float v5, v5, v6

    .line 15
    iget-object v7, v2, Les/cd$r;->e:Ljava/lang/String;

    iget v8, v2, Les/cd$r;->g:F

    mul-float v8, v8, v4

    invoke-static {v7, v8}, Lcom/esfile/screen/recorder/videos/edit/activities/caption/r;->b(Ljava/lang/String;F)F

    move-result v7

    .line 16
    iget-object v8, v2, Les/cd$r;->e:Ljava/lang/String;

    iget v9, v2, Les/cd$r;->g:F

    mul-float v9, v9, v4

    invoke-static {v8, v9}, Lcom/esfile/screen/recorder/videos/edit/activities/caption/r;->a(Ljava/lang/String;F)F

    move-result v8

    const/high16 v9, 0x40000000    # 2.0f

    div-float/2addr v7, v9

    sub-float v10, v3, v7

    div-float/2addr v8, v9

    sub-float v9, v5, v8

    add-float/2addr v3, v7

    add-float/2addr v5, v8

    .line 17
    invoke-virtual {v1, v10, v9, v3, v5}, Landroid/graphics/RectF;->set(FFFF)V

    .line 18
    iget v3, v2, Les/cd$r;->d:F

    invoke-static {p0, v1, v3, v0}, Lcom/esfile/screen/recorder/videos/edit/activities/decor/b;->a(Landroid/content/Context;Landroid/graphics/RectF;FLandroid/graphics/Rect;)V

    .line 19
    invoke-virtual {v1}, Landroid/graphics/RectF;->centerX()F

    move-result v3

    div-float/2addr v3, v4

    iput v3, v2, Les/cd$r;->b:F

    .line 20
    invoke-virtual {v1}, Landroid/graphics/RectF;->centerY()F

    move-result v3

    div-float/2addr v3, v6

    iput v3, v2, Les/cd$r;->c:F

    goto :goto_0

    :cond_1
    :goto_1
    return-void
.end method

.method public static b(Ljava/lang/String;F)F
    .locals 7

    .line 1
    invoke-static {p0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    const/4 v1, 0x0

    if-eqz v0, :cond_0

    return v1

    .line 2
    :cond_0
    new-instance v0, Landroid/graphics/Paint;

    invoke-direct {v0}, Landroid/graphics/Paint;-><init>()V

    .line 3
    invoke-virtual {v0, p1}, Landroid/graphics/Paint;->setTextSize(F)V

    const/4 p1, 0x1

    .line 4
    invoke-virtual {v0, p1}, Landroid/graphics/Paint;->setAntiAlias(Z)V

    const-string p1, "\n"

    .line 5
    invoke-virtual {p0, p1}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object p0

    .line 6
    new-instance p1, Landroid/graphics/Rect;

    invoke-direct {p1}, Landroid/graphics/Rect;-><init>()V

    .line 7
    array-length v2, p0

    const/4 v3, 0x0

    const/4 v4, 0x0

    :goto_0
    if-ge v4, v2, :cond_2

    aget-object v5, p0, v4

    if-eqz v5, :cond_1

    .line 8
    invoke-virtual {v5}, Ljava/lang/String;->length()I

    move-result v6

    invoke-virtual {v0, v5, v3, v6, p1}, Landroid/graphics/Paint;->getTextBounds(Ljava/lang/String;IILandroid/graphics/Rect;)V

    .line 9
    invoke-virtual {p1}, Landroid/graphics/Rect;->width()I

    move-result v5

    int-to-float v5, v5

    invoke-static {v1, v5}, Ljava/lang/Math;->max(FF)F

    move-result v1

    :cond_1
    add-int/lit8 v4, v4, 0x1

    goto :goto_0

    :cond_2
    return v1
.end method
